Take-home Exercise 2

Spatial Point Patterns Analysis of Airbnb Listing in Singapore

Lye Jia Wei https://example.com/norajones
09-15-2021

1. Problem Statement

2. Data

In this analysis, the following dataset were used:

Data Description Format Source
Airbnb listings for June 2019 and June 2021 Airbnb listings information including room type an location CSV Airbnb Listing
Hotels, tourist attractions Locations of hotels and tourist attractions extracted using OneMap API CSV OneMap API
MRT Stations Point representation to indicate the location of the MRT station. SHP LTA Datamall
Singapore Costal Outline Coastal outline shp file from Data.gov.sg SHP Data.gov.sg

3. Installing and Loading the R packages

In this analysis, CHANGE THIS 8 packages will be used, they are:

Use the code chunk below to install and launch the 8 R packages.

library(caret) library(dplyr) library(ggmap)

4. Data Wrangling

4.1 Load Airbnb Listings Data

In this section, read_csv() of tidyverse package will be used to import the airbnb data sets into R.

We will name the airbnb listing data dated June 2021 as airbnb21 while the other data which is dated June 2019 will be named airbnb19

4.1.1 Understanding Airbnb Listings Data

summary(airbnb21)
summary(airbnb19)

4.1.2 Analyse airbnb Availability Data

With information from Airbnb the value of the availability_365 column is based on the following:

The count of availability_365 of June 2019 is plot on the graph below.

A quick glance at the data suggest that there are about 1300+ listings with availability equals 0, it is highly unlikely for all of them to be fully booked.

The count of availability_365 of June 2021 is plot on the graph below.

Likewise, in 2021 there are 400 listings with availability equals 0

There is a high probability that most of those listings have host that are no longer planning to accept any guest, but host have yet to remove their listing. Hence, we will proceed to filter these listings out.

4.1.3 Analyse Airbnb Reviews Data

Next, we will plot a graph to find out the distribution of the number of reviews in airbnb19

There are about 2500+ listings with 0 reviews, reason they could be 0 could be:

  1. No guest has ever stayed there before
  2. Guest have stayed but decided not to leave any reviews after the stay

Again, we will plot a graph to find out the distribution of the number of reviews in airbnb21

We will then remove listings with number of reviews equals 0 since they may be inactive listings.

4.1.4 CRS check

Coordinate Reference System: NA
Coordinate Reference System: NA

A quick CRS check shows that there are no Coordinate Reference System assigned yet.

4.1.5 NA and Geometric Validity Checks and Correction

# A tibble: 0 x 16
# ... with 16 variables: id <dbl>, name <chr>, host_id <dbl>,
#   host_name <chr>, neighbourhood_group <chr>, neighbourhood <chr>,
#   latitude <dbl>, longitude <dbl>, room_type <chr>, price <dbl>,
#   minimum_nights <dbl>, number_of_reviews <dbl>,
#   last_review <date>, reviews_per_month <dbl>,
#   calculated_host_listings_count <dbl>, availability_365 <dbl>
# A tibble: 75 x 16
        id name       host_id host_name neighbourhood_g~ neighbourhood
     <dbl> <chr>        <dbl> <chr>     <chr>            <chr>        
 1 2838555 1 Bedroom~  1.45e7 <NA>      Central Region   Geylang      
 2 2840554 Spacious ~  1.45e7 <NA>      Central Region   Geylang      
 3 3140972 Ground fl~  1.45e7 <NA>      Central Region   Geylang      
 4 3144267 Furnished~  1.45e7 <NA>      Central Region   Geylang      
 5 3258894 Nicely Fu~  1.45e7 <NA>      Central Region   Geylang      
 6 3617090 Cosy 1 Be~  1.45e7 <NA>      Central Region   Geylang      
 7 3671451 Nice and ~  1.45e7 <NA>      Central Region   Geylang      
 8 3752662 Nice 1 Be~  1.45e7 <NA>      Central Region   Geylang      
 9 3790364 Spacious ~  1.45e7 <NA>      Central Region   Geylang      
10 3859180 Ground fl~  1.45e7 <NA>      Central Region   Geylang      
# ... with 65 more rows, and 10 more variables: latitude <dbl>,
#   longitude <dbl>, room_type <chr>, price <dbl>,
#   minimum_nights <dbl>, number_of_reviews <dbl>,
#   last_review <date>, reviews_per_month <dbl>,
#   calculated_host_listings_count <dbl>, availability_365 <dbl>

From the output, it appears that airbnb21 has no missing values while airbnb19 seems to be missing host_name. Hence, we will proceed to drop these values.

4.1.6 CRS Reassignment & Convert to SF class

4.1.7 Geometry Check

[1] 0
[1] 0

All geometries are valid. We can now plot airbnb19 and airbnb21 .

4.1.8 Visualizing airbnb19 for review

From the above plot, we see some suspicious listings in strange location e.g located in parks or in sensitive installation such as military camp

We will proceed to remove these listings by using filter().

4.1.9 Visualizing airbnb21 view

Likewise,we will proceed to remove these listings by using filter().

4.1.10 Converting airbnb19_sf and airbnb_21 sf data frames to sp’s Spatial* class

The code chunk below uses as_Spatial() of sf package to convert the three geospatial data from simple feature data frame to sp’s Spatial* class.

4.1.11 Converting the Spatial* class into generic sp format

spatstat requires the analytical data in ppp object form. There is no direct way to convert a Spatial* classes into ppp object. We need to convert the Spatial classes* into Spatial object first.

The codes chunk below converts the Spatial* classes into generic sp objects.

Check the sp objects properties

class       : SpatialPoints 
features    : 4275 
extent      : 7215.566, 43591.65, 25170.77, 47923.77  (xmin, xmax, ymin, ymax)
crs         : +proj=tmerc +lat_0=1.36666666666667 +lon_0=103.833333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +datum=WGS84 +units=m +no_defs 
class       : SpatialPoints 
features    : 2257 
extent      : 7406.989, 43337.89, 25330, 48127.23  (xmin, xmax, ymin, ymax)
crs         : +proj=tmerc +lat_0=1.36666666666667 +lon_0=103.833333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +datum=WGS84 +units=m +no_defs 

4.1.12 Converting the generic sp format into spatstat’s ppp format

Now, we will use as.ppp() function of spatstat to convert the spatial data into spatstat’s ppp object format.

4.1.13 Handling duplicated points

We can check the duplication in a ppp object by using the code chunk below.

[1] TRUE
[1] TRUE

The code chunk below implements the jittering approach to remove duplicated points.

4.2 Load Hotels,Tourism,SG and MRT Data

Next, we will:

OGR data source with driver: ESRI Shapefile 
Source: "C:\lye-jia-wei\IS415_New_Blog\_posts\2021-09-21-take-home-exercise-2\data\aspatial", layer: "CostalOutline"
with 60 features
It has 4 fields
Reading layer `MRTLRTStnPtt' from data source 
  `C:\lye-jia-wei\IS415_New_Blog\_posts\2021-09-21-take-home-exercise-2\data\aspatial\MRTLRTStnPtt.shp' 
  using driver `ESRI Shapefile'
Simple feature collection with 185 features and 3 fields
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 6138.311 ymin: 27555.06 xmax: 45254.86 ymax: 47854.2
Projected CRS: SVY21

4.2.1 Create Hotels,Tourist Attractions, MRT simple feature and Spatial data point

4.2.2 Converting from Spatial objects into ppp objects

4.2.3 Remove duplicate points using Jitter

4.3 Create SG Owin Object

When analysing spatial point patterns, it is a good practice to confine the analysis with a geographical area like Singapore boundary. In spatstat, an object called owin is specially designed to represent this polygonal region.

The code chunk below is used to covert sg SpatialPolygon object into owin object of spatstat.

4.4 Combining point events object and owin object

5. Airbnb Distribution in 2019

5.1 Exploratory Spatial Data Analysis

5.1.1 Rescalling KDE values

In the code chunk below, rescale() is used to covert the unit of measurement from meter to kilometer.

5.1.2 COMPUTING KDE BY USING ADAPTIVE BANDWIDTH

Kernel Density Map of Airbnb (2019)

Kernel Density Map of Tourist Attractions

Kernel Density Map of Hotels

Kernel Density Map of MRT Stations

5.1.2 Converting KDE output into grid objec

The result is the same, we just convert it so that it is suitable for mapping purposes

5.1.3 CONVERTING GRIDDED OUTPUT INTO RASTER

Next, we will convert the gridded kernal density objects into RasterLayer object by using raster() of raster package.

5.1.4 ASSIGNING PROJECTION SYSTEMS

The code chunk below will be used to include the CRS information

5.1.5 Visualising the output in tmap

Kernel density maps of Tourist Attractions on Openstreetmap of Singapore

Kernel density maps of Airbnb Listings (2019) on Openstreetmap of Singapore

Kernel density maps of Hotels on Openstreetmap of Singapore

Kernel density maps of MRT station on Openstreetmap of Singapore

5.1.6 Comparing Spatial Point Patterns using KDE

5.2 Second-order Spatial Point Patterns Analysis

5.2.1 Analysing Spatial Point Process Using G-Function

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

5.2.1.1 Airbnb 2019 Data

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of airbnb are randomly distributed.

H1= The distribution of airbnb are not randomly distributed.

The null hypothesis will be rejected if p-value is smaller than alpha value of 0.001.

Monte Carlo test with G-fucntion

Generating 40 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39,  40.

Done.

5.2.1.2 MRT Data

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of MRT are randomly distributed.

H1= The distribution of MRT are not randomly distributed.

The null hypothesis will be rejected if p-value is smaller than alpha value of 0.001.

Monte Carlo test with G-fucntion

Generating 40 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39,  40.

Done.

5.2.1.3 Attractions Data

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of tourist attractions are randomly distributed.

H1= The distribution of tourist attractions are not randomly distributed.

The null hypothesis will be rejected if p-value is smaller than alpha value of 0.001.

Monte Carlo test with G-fucntion

Generating 40 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39,  40.

Done.

5.2.1.4 Hotels

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of hotels are randomly distributed.

H1= The distribution of hotels are not randomly distributed.

The null hypothesis will be rejected if p-value is smaller than alpha value of 0.001.

Monte Carlo test with G-fucntion

Generating 40 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39,  40.

Done.

6. Section B: Impact of COVID-19

In this section, we will use appropriate tmap function to display the locations of the Airbnb listing by room type, and describe the spatial patterns observed.

Plotting an interactive map to depict the locations of Airbnb listing by room type, with Openstreetmap of Singapore as background. Setting the 4 different room types as different coloured b ubbble, we plot an interactive map to clearly identify which area has the most rooms, and which room type is the most popular.

6.1 Exploratory Spatial Data Analysis

6.1.1 Plotting an interactive map to show the various Airbnb room types across Singapore (2019)

At first glance, it is very clear that the Central Region has the most airbnb listings and that “entire home/apt” is the most frequent room rented out in the Central Region. However, if we take a look at the whole map, it is interesting to note that majority of the listings are of ‘private room’ category in other areas of Singapore.

6.1.2 Plotting an interactive map to show the various Airbnb room types across Singapore (2021)

The same observation of Central Region having the most airbnb listings and that “entire home/apt” is the most frequent room rented out in the Central Region remain true in 2021.

From the map, we can also observe that there is a ‘hotel room’ category which does not exist in 2019 listing.

A quick glance at the map suggest that overall there seems to be less listings in the year 2021 compared to 2019

6.1.3 Creating New Dataframe by Room Types

We would like to analyse each of the 4 individual room types, to analyse whether they are random or clustered, and if clustered, which are the clustered locations. This will help us in understanding the relationship between location and room type in Singapore.

The following code chunk will create a new dataframe by filtering out the different room types:

6.1.3 Plotting for Reviewing

Private Room Type (2021)

The graph shows the distribution of Airbnb private room types (2021) across the Singapore map, and we can see significant clustering at the Central area.

Private Room Type (2019)

The graph shows the distribution of Airbnb private room types across the Singapore map, and we can that private housing listing is significantly more dense in 2021 compared to 2019 throughout Singapore.

Shared Room Type (2021)

The graph shows the distribution of Airbnb shared room types (2021) across the Singapore map, and we can see significant clustering at the Central area and some listings in the north.

Shared Room Type (2019)

Unlike private room listings, the shared room listings appears to be more densely clusted in 2019 compared to 2021.

Entire Home/Apartment (2021)

The graph shows the distribution of Airbnb apartment room types (2021) across the Singapore map, and we can see significant clustering at the Central area.

Entire Home/Apartment (2019)

The graph shows the distribution of Airbnb apartment room types across the Singapore map, and we can see that the distribution of such room type is more disperse geographically in Singapore compared to other listings, though it is still clustered in the central area of Singapore.

Hotel Room Type (2021)

Hotel room type is only present in the airbnb21 dataframe and it is clustered around central region of Singapore.

6.1.4 Converting the Spatial* class into generic sp format

Spatstat requires the analytical data in ppp object form. There is no direct way to convert a Spatial* classes into ppp object. We need to convert the Spatial classes* into Spatial object first.

The codes chunk below converts the Spatial* classes into generic sp objects

6.1.5 Converting the generic sp format into spatstat’s ppp format

6.1.6 Handling duplicated points

The following code chunk will remove duplicate points using Jitter

6.1.7 Combining point events object and owin object

6.1.8 Visualise ppp object by the density of points using a Gaussian

(normal) kernel with a 1000m standard deviation (sigma)

Kernel Density Map of Private Room Type

Kernel Density Map of Shared Room Type

Kernel Density Map of Apartment Room Type

Kernel Density Map of Hotel Room Type

6.1.9 Rescale the unit of measurement from meter to kilometer and recalculate density

6.1.10 Re-run density() using the rescale data set and plot the output KDE map

Kernel Density Map of Private Room Type

Kernel Density Map of Shared Room Type

Kernel Density Map of Apartment Room Type

Kernel Density Map of Hotel Room Type

6.1.11 Converting KDE output into grid object

The result is the same, we just convert it so that it is suitable for mapping purposes

6.1.12 Converting gridded output into raster

6.1.13 Assigning projection systems

6.1.14 Plotting the kernel density map on openstreetmap of Singapore

Kernel Density Map of Private Room Type (2019)
Kernel Density Map of Private Room Type (2021)
Kernel Density Map of Shared Room Type (2019)
Kernel Density Map of Shared Room Type (2021)
Kernel Density Map of Apartment Room Type (2019)
Kernel Density Map of Apartment Room Type (2021)
Kernel Density Map of Hotel Room Type (2021)

6.2 Second-order Spatial Point Patterns Analysis

With reference to the spatial point patterns observed previously, we will attempt to formulate the null hypothesis and alternative hypothesis, and select the confidence level.

Then, we will perform the test by using appropriate 2nd order spatial point patterns analysis technique, before drawing statistical conclusions. We will be using G-Function and L-Function to derive our conclusion. This is because the F-Function is based on distance pairs which is not really relevant to us as compared to G-Function which is based on nearest neighbour distances. Since L-Function is the normalised version of K-Function, it will make more sense to use L-Function instead of K-Function.

6.2.1 Analysing Spatial Point Process Using G-Function

Private Room (2019)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of private room types in Singapore during 2019 are randomly distributed H1: Distribution of private room types in Singapore during 2019 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of private room types in Singapore is randomly distributed.

As the G increases rapidly at the start (short distance), this tells us that the points of private room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to visualise.

Private Room (2021)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of private room types in Singapore during 2021 are randomly distributed H1: Distribution of private room types in Singapore during 2021 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of private room types in Singapore is randomly distributed.

As the G increases rapidly at the start (short distance), this tells us that the points of private room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to

Shared Room (2019)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of shared room types in Singapore during 2019 are randomly distributed H1: Distribution of shared room types in Singapore during 2019 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of private room types in Singapore is randomly distributed.

As the G increases rapidly at the start (short distance), this tells us that the points of shared room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to visualise.

Shared Room (2021)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of shared room types in Singapore during 2021 are randomly distributed H1: Distribution of shared room types in Singapore during 2021 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of shared room types in Singapore is randomly distributed.

As the G increases rapidly at the start (short distance), this tells us that the points of shared room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to visualise.

Apartment Room Type (2019)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of apartment room types in Singapore during 2019 are randomly distributed H1: Distribution of apartment room types in Singapore during 2019 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of apartment room types in Singapore is randomly distributed. apartment room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to visualise.

Shared Room (2021)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of apartment room types in Singapore during 2021 are randomly distributed H1: Distribution of apartment room types in Singapore during 2021 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of apartment room types in Singapore is randomly distributed.

As the G increases rapidly at the start (short distance), this tells us that the points of shared room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to visualise.

Hotel Room (2021)

G function estimation

Performing Complete Spatial Randomness Test H0: Distribution of hotel room types in Singapore during 2021 are randomly distributed H1: Distribution of hotel room types in Singapore during 2021 are not randomly distributed Null hypothesis will be rejected if p values is smaller than alpha value of 0.001

Monte Carlo test with G function (1000 simulations)

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Since the estimated G(r) function lies above the envelope from point 0, the estimated G(r) is statistically significant. Reject null hypothesis that the distribution of hotel room types in Singapore is randomly distributed.

As the G increases rapidly at the start (short distance), this tells us that the points of hotel room type in Singapore are clustered. This observation is consistent with the ppp graph that we have previously plotted to visualise.

6.2.2 Analysing Spatial Point Process Using L-Function

Private Room Type (2019)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of private room in Singapore are randomly distributed.

H1= The distribution of private room in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Private Room Type (2021)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of private room in Singapore are randomly distributed.

H1= The distribution of private room in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Shared Room Type (2019)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of shared room in Singapore are randomly distributed.

H1= The distribution of shared room in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Shared Room Type (2021)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of shared room in Singapore are randomly distributed.

H1= The distribution of shared room in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Apartment Room Type (2019)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of apartment in Singapore are randomly distributed.

H1= The distribution of apartment in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Apartment Type (2021)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of apartment in Singapore are randomly distributed.

H1= The distribution of apartment in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.

Hotel Room Type (2021)

COMPUTING L FUCNTION ESTIMATION

PERFORMING COMPLETE SPATIAL RANDOMNESS TEST

To confirm the observed spatial patterns above, a hypothesis test will be conducted. The hypothesis and test are as follows:

Ho = The distribution of hotel listings in Singapore are randomly distributed.

H1= The distribution of hotel listings in Singapore are not randomly distributed.

The null hypothesis will be rejected if p-value if smaller than alpha value of 0.001.

The code chunk below is used to perform the hypothesis testing.

Generating 9 simulations of CSR  ...
1, 2, 3, 4, 5, 6, 7, 8,  9.

Done.